<template>
  <svg class="icon" aria-hidden="true">
    <use :xlink:href="iconClassName" :fill="color" />
  </svg>
</template>

<script setup lang="ts">
  import { computed } from 'vue'
  interface PropsData {
    iconName: string
    color?: string
  }
  const props = defineProps<PropsData>()
  const iconClassName = computed(() => {
    return `#${props.iconName}`
  })
</script>

<style lang="scss" scoped>
  .icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
  }
</style>
